package org.lee.springcloud.provider.controllers;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jackielee
 * @version 1.0
 * @description UserController
 * @date 2021/3/26
 */
@RestController
@RequestMapping("/user")
public class UserController {

  @Value("${server.name}")
  private String serverName;

  /**
   * hello
   * @param user
   * @return
   */
  @GetMapping("/hello")
  public String hello(String user) {
    return "hello " + user + ", from " + serverName;
  }

  /**
   * getinfo
   * @param user
   * @param message
   * @return
   */
  @GetMapping("/getinfo")
  public String hello(String user, String message) {
    return "hello " + user + ",the message " + message + " is for you, from " + serverName;
  }
}
